package com.cskaoyan.bean.chenfeng.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author Chen_Feng
 * @since 2022/06/29 00:41
 */

public class StatOrderVo {

    /**
     * columns : ["day","orders","customers","amount","pcr"]
     * rows : [{"amount":280,"orders":3,"customers":1,"day":"2022-06-26","pcr":280},{"amount":3109,"orders":8,"customers":1,"day":"2022-06-27","pcr":3109},{"amount":10220,"orders":5,"customers":1,"day":"2022-06-28","pcr":10220}]
     */
    private List<String> columns = Arrays.asList("day", "orders", "customers", "amount", "pcr");
    private List<RowsEntity> rows;

    public void setColumns(List<String> columns) {
        this.columns = columns;
    }

    public void setRows(List<RowsEntity> rows) {
        this.rows = rows;
    }

    public List<String> getColumns() {
        return columns;
    }

    public List<RowsEntity> getRows() {
        return rows;
    }

    public static class RowsEntity {
        /**
         * amount : 280
         * orders : 3
         * customers : 1
         * day : 2022-06-26
         * pcr : 280
         */
        private Integer amount;
        private Integer orders;
        private Integer customers;
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        private Date day;
        private Integer pcr;

        public void setAmount(Integer amount) {
            this.amount = amount;
        }

        public void setOrders(Integer orders) {
            this.orders = orders;
        }

        public void setCustomers(Integer customers) {
            this.customers = customers;
        }

        public void setDay(Date day) {
            this.day = day;
        }

        public void setPcr(Integer pcr) {
            this.pcr = pcr;
        }

        public Integer getAmount() {
            return amount;
        }

        public Integer getOrders() {
            return orders;
        }

        public Integer getCustomers() {
            return customers;
        }

        public Date getDay() {
            return day;
        }

        public Integer getPcr() {
            return pcr;
        }
    }
}
